<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试1</title>
</head>
<?php 

$m = new Mongo();
$db = $m->taobao;
$c = $db->test;

$obj = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" );
$c->insert($obj);

$obj = array( "title" => "XKCD", "online" => true );
$c->insert($obj);

// find everything in the collection
$cursor = $c->find();

// iterate through the results
foreach ($cursor as $obj) {
    echo $obj["title"] . "\n";
}

?>

<body>
</body>
</html>